import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPageByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteMacList/${params?.pageNum}/${params?.pageSize}/${params?.mac || "0"}/${params?.startTime || "0"}/${params?.endTime || "0"}`); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteMacAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteMacUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteMacDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 查询列表
export const getDataByPageByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteIpList/${params?.pageNum}/${params?.pageSize}/${params?.ip || "0"}/${params?.startTime || "0"}/${params?.endTime || "0"}`); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteIpAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteIpUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/whiteIpDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
